//
//  ViewController.h
//  SocketTelnet
//
//  Created by Hur Song on 12. 12. 10..
//  Copyright (c) 2012년 song. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "DataListTableView.h"
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <stdio.h>
#include <string.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <net/if.h>

@interface ViewController : UIViewController <DataListDelegate>

@property (nonatomic, strong) IBOutlet	UITextField		*	ipAddrLabel;
@property (nonatomic, strong) IBOutlet	UITextField		*	portLabel;
@property (nonatomic, strong) IBOutlet	UIButton		*	connectButton;
@property (nonatomic, strong) IBOutlet	UIButton		*	disconnectButton;
@property (nonatomic)			struct  sockaddr_in			socketAddr;
@property (nonatomic, strong)			NSMutableArray	*	listData;

@property (nonatomic, strong) IBOutlet	UILabel			*	massageLabel;
@property (nonatomic)					int					command_socket;
@property (nonatomic)					int					data_client;
@property (nonatomic, strong) DataListTableView			*	dataListTableViewController;


- (IBAction)respondsToConnect:(id)sender;
- (IBAction)respondsToDisconnect:(id)sender;
- (IBAction)respondsToLogin:(id)sender;
- (IBAction)respondsToGetList:(id)sender;

- (int)recvResponse;
- (void)recvData;
- (void)handleGetList;
- (void) openDataChannel;
- (void) make_ip;

- (IBAction)respondsToPort:(id)sender;
@end
